package com.zhiwang.planet.ui.money


import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup

import com.zhiwang.planet.R
import com.zhiwang.planet.ui.BaseFragment
import kotlinx.android.synthetic.main.fragment_loan.*

/**
 * A simple [Fragment] subclass.
 *
 */
class LoanFragment : BaseFragment() {

    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
                              savedInstanceState: Bundle?): View? {
        // Inflate the layout for this fragment
        return inflater.inflate(R.layout.fragment_loan, container, false)
    }


    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        recyclerView.adapter = LoanAdapter()
    }

    inner class LoanAdapter : androidx.recyclerview.widget.RecyclerView.Adapter<VH>() {

        override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): VH {
            return VH(layoutInflater.inflate(R.layout.item_loan, parent, false))
        }

        override fun getItemCount(): Int {
            return 15
        }

        override fun getItemViewType(position: Int): Int {
            return super.getItemViewType(position)
        }

        override fun onBindViewHolder(holder: VH, position: Int) {

        }

    }

    class VH : androidx.recyclerview.widget.RecyclerView.ViewHolder {

        constructor(itemView: View) : super(itemView)
    }
}
